// vite.config.js
import { defineConfig } from "vite";
import vue from '@vitejs/plugin-vue';

export default defineConfig({
  plugins: [vue()],
  server: {
    host: '0.0.0.0', // 允许外部访问
    port:3000,    
    hmr: {
      overlay: false,
    },    
    proxy: {
      '/srs': {
        target: 'http://192.168.1.124',
       //target: 'http://192.168.1.78',
        changeOrigin: true,
        ws: true,
        rewrite: path => path.replace(/^\/srs/, '')
      },
      '/apk': {
        target: 'http://192.168.1.124:9091',
       // target: 'http://127.0.0.1:9090',
        changeOrigin: true,
        ws: true,
        rewrite: path => path.replace(/^\/apk/, '')
      },
      '/bik': {
        target: 'http://47.116.175.198:8020',
       // target: 'http://127.0.0.1:9090',
        changeOrigin: true,
        ws: true,
        rewrite: path => path.replace(/^\/bik/, '')
      },
    },
  },
});